import request from '@/utils/request'

// 巡查任务分页列表
export function getSurveyTaskList(params) {
  return request({
    url: '/safe/SurveyTaskList',
    method: 'get',
    params: params
  })
}

// 新增巡查任务
export function addSurveyTask(data) {
  return request({
    url: '/safe/addSurveyTask',
    method: 'post',
    data: data
  })
}

// 修改巡查任务
export function updateSurveyTask(data) {
  return request({
    url: '/safe/updateSurveyTask',
    method: 'post',
    data: data
  })
}

// 获取巡查任务详情
export function getSurveyTaskDetail(id) {
  return request({
    url: `/safe/SurveyTaskDetail/${id}`,
    method: 'get'
  })
}

// 删除巡查任务
export function deleteSurveyTask(id) {
  return request({
    url: `/safe/deleteSurveyTask/${id}`,
    method: 'post'
  })
}

// 获取巡查任务年度列表
export function getSurveyTaskYearList() {
  return request({
    url: '/safe/surveyTaskYearList',
    method: 'get'
  })
}